import React from "react";
import styles from "./index.module.less";
import SvgIcon from "@components/SvgIcon";
import { isInSearch } from "@redux/actions02";
import { connect } from "react-redux";

const AddrBookSearchMould = (props) => {
    const { isInSearch } = props;

    return (
        <div className={styles.search_wrap}>
            <div className={styles.search_main}>
                <div className={styles.search_icon}>
                    <SvgIcon font="icon-search" />
                </div>
                <input
                    type="text"
                    className={styles.inner}
                    placeholder="搜索"
                />
                <div className={styles.x}>
                    <div className={styles.x_icon}>
                        <SvgIcon font="icon-cuowuguanbiquxiao-yuankuang" />
                    </div>
                </div>
            </div>
            <div
                className={styles.add_wrap}
                title="添加朋友"
                onClick={() => {
                    isInSearch(true);
                }}
            >
                <SvgIcon font="icon-tianjiayonghu" />
            </div>
        </div>
    );
};

export default connect((state) => state, { isInSearch })(AddrBookSearchMould);
